package top.lixunda.books3.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.lixunda.books3.dao.BookGoodsMapper;
import top.lixunda.books3.model.SimpleGoods;
import top.lixunda.books3.service.GoodsService;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {

    private final BookGoodsMapper goodsMapper;

    @Autowired
    public GoodsServiceImpl(BookGoodsMapper goodsMapper) {
        this.goodsMapper = goodsMapper;
    }

    @Override
    public List<SimpleGoods> querySimpleGoodsByBook(long id, long start, int count) {
        return goodsMapper.getAbleGoodsByBook(id, start, count);
    }

    @Override
    public long querySimpleGoodsCountByBook(long id) {
        return goodsMapper.getAbleGoodsCountByBook(id);
    }
}
